<template>
  <div>
    <div class="header">

     <div class="iconfont header-back" @click="clickBack">&#xe624;</div>

      <div class="header-title">
        攻略点评
      </div>
    </div>

    <div class="gonglue-detail">
      <div class="gonglue-author">
        <div class="author">{{gonglueItem.userName}}</div>
        <div class="date">{{gonglueItem.gonglueTime}}</div>
      </div>
      <div class="gonglue-title">{{gonglueItem.gonglueTitle}}</div>
      <div class="gonglue-content">{{gonglueItem.gonglueContent}}</div>
      <div class="imgbox">
        <img v-for="(img,index) of gonglueItem.gonglueImgs"  :src="img" :key="index"/>
      </div>
    </div>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  props: {},
  data () {
    return {
      gonglueItem: {}
    }
  },
  methods: {
    clickBack: function () {
      this.$router.go(-1)
    },
    getgonglueItem: function () {
      axios.get('/api/gonglue.json', {
        params: {
          id: this.$route.params.id
        }
      }).then((res) => {
        res = res.data
        if (res.ret && res.data) {
          this.gonglueItem = res.data.gonglueList[0]
        }
      })
    }
  },
  components: {},
  computed: {},
  mounted () {
    // 获得解析的参数
    this.getgonglueItem()
  }
}
</script>

<style lang="stylus" scoped>
  @import "~styles/varibles.styl"
  .header
    height: $headerHeight
    line-height: $headerHeight
    font-size: 0.36rem
    text-align :center
    color :#ffffff
    background-color :$bgColor
    position :fixed
    top: 0
    left :0
    right :0
    z-index :5
    .header-back
      width :0.64rem
      color :#ffffff
      position :absolute
      font-size :0.4rem
      text-align: center
      top: 0
      left : 0
    .header-title
      width :80%
      padding :0 10%
      color :#fff
  .gonglue-detail
    margin-top :0.86rem
    padding :0.1rem 0.2rem 0 0.2rem
    .gonglue-author
      display :flex
      justify-content:space-between
      color: #9e9e9e
    .gonglue-title
      padding-top :0.1rem
      color: #212121
      font-size: .32rem
      line-height: .48rem
      font-weight: bold
      width: 100%
    .gonglue-content
      text-indent :0.56rem
      font-size: .28rem
      line-height: 1.5
    .imgbox
      img
        width :100%
        margin-top :0.2rem

</style>
